const std = @import("std");
const myzql = @import("myzql");
const Conn = myzql.conn.Conn;
const PreparedStatement = myzql.result.PreparedStatement;
const ResultSet = myzql.result.ResultSet;
const BinaryResultRow = myzql.result.BinaryResultRow;

var db_client:Conn=undefined;

pub fn init(allocator: anytype) !void{
    db_client = try Conn.init(
        allocator,
        &.{
            .username = "root", // default: "root"
            .password = "root", // default: ""
            .database = "default", // default: ""

            // Current default value.
            // Use std.net.getAddressList if you need to look up ip based on hostname
            .address = std.net.Address.initIp4(.{ 127, 0, 0, 1 }, 3306),
            // ...
        },
    );
}

pub fn get_db_client() *Conn{
    return &db_client;
}